package org.itboys.core.entity.mongo.dispatch;

import lombok.Data;
import org.itboys.mongodb.entity.BaseMongoEntity;
import org.mongodb.morphia.annotations.Entity;

import java.util.List;


/**
*@Author: jiaqilei
*@Date: 15:59 2018/12/14
*@Discription: 调度单实体类
*/
@Data
@Entity(value = "SundayDispatchOrder",noClassnameStored = true)
public class SundayDispatchOrder extends BaseMongoEntity{
    /**发起方*/
    private Long applyId;
    /**发起方名称*/
    private String applyName;
    /**申请仓库id*/
    private Long applyStoreId;
    /**申请仓库名称*/
    private String applyStoreName;
    /**接受方*/
    private Long acceptId;
    /**接受方名称*/
    private String acceptName;
    /**接受仓库名称*/
    private String acceptStoreName;
   /**状态，查看SundayCommonConstants*/
    private Integer state;

    /**相关模板信息*/
    private List<SundayDispatchModel> models;

    public String getStateStr(){
        if(state==null) return "";
        else if(state==0) return "初始化";
        else if(state==1) return "已审核";
        else if(state==2) return "已接单";
        else if(state==3) return "已分配";
        else if(state==4) return "已完成";
        return "";
    }


}
